package com.tanhua.dubbo.api;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.dubbo.mappers.ListMapper;
import com.tanhua.model.soul.Lists;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;


@DubboService
public class ListApiImpl implements ListApi {
    @Autowired
    private ListMapper listMapper;

    @Override
    public Lists findListOne() {
        Long id=1L;
        Lists list = listMapper.selectById(id);
        System.out.println(list);
        return list;
    }

    @Override
    public java.util.List<Lists> findListAll() {
        LambdaQueryWrapper<Lists> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(Lists::getStar);
        return listMapper.selectList(queryWrapper);
    }

    @Override
    public Lists findById(Long id) {
        return listMapper.selectById(id);
    }
}
